// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';
const apiPrefix = '/web';

/** 获取电站信息 获取电站信息 GET /station/${param0} */
export async function stationControllerGetStation(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationControllerGetStationParams,
  options?: { [key: string]: any },
) {
  const { id: param0, ...queryParams } = params;
  return request<API.StationInfo>(`${apiPrefix}/station/${param0}`, {
    method: 'GET',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 新增电站 新增电站 POST /station/add */
export async function stationControllerAddStation(
  body: API.StationReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/add`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 基础参数配置 保存站点基础配置 POST /station/baseconfig */
export async function stationControllerSaveBaseConfig(
  body: API.StationBaseReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/baseconfig`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 批量操作 批量操作 POST /station/batch */
export async function stationControllerBatch(
  body: API.BatchOperatorReq,
  options?: { [key: string]: any },
) {
  return request<API.ApiResult>(`${apiPrefix}/station/batch`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导出数据 导出数据 GET /station/download/excel */
export async function stationControllerDownloadExcel(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationControllerDownloadExcelParams,
  options?: { [key: string]: any },
) {
  return request<any>(`${apiPrefix}/station/download/excel`, {
    method: 'GET',
    params: {
      ...params,
      search: undefined,
      ...params['search'],
    },
    ...(options || {}),
  });
}

/** 编辑电站 编辑电站 POST /station/edit */
export async function stationControllerEditStation(
  body: API.StationReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/edit`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 系统自增站点编码 GET /station/increment */
export async function stationControllerNextStationNo(options?: { [key: string]: any }) {
  return request<API.ApiResultString>(`${apiPrefix}/station/increment`, {
    method: 'GET',
    ...(options || {}),
  });
}

/** 分页查询 分页查询电站数据 GET /station/list */
export async function stationControllerList(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.stationControllerListParams,
  options?: { [key: string]: any },
) {
  return request<API.Pagination>(`${apiPrefix}/station/list`, {
    method: 'GET',
    params: {
      ...params,
      search: undefined,
      ...params['search'],
      page: undefined,
      ...params['page'],
    },
    ...(options || {}),
  });
}

/** 服务配置 保存电站服务配置 POST /station/serveconfig */
export async function stationControllerSaveServeConfig(
  body: API.StationServeReq,
  options?: { [key: string]: any },
) {
  return request<boolean>(`${apiPrefix}/station/serveconfig`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 导入文件 导入文件数据 POST /station/upload/excel */
export async function stationControllerUploadExcel(body: {}, options?: { [key: string]: any }) {
  return request<API.ApiResult>(`${apiPrefix}/station/upload/excel`, {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
